import request from '/@/utils/request'

// 查询邮件发送列表
export function listPluginMail(query: object) {
    return request({
        url: '/api/v1/plugins/mail/mail/list',
        method: 'get',
        params: query
    })
}

// 查询邮件发送详细
export function getPluginMail(id: number) {
    return request({
        url: '/api/v1/plugins/mail/mail/get',
        method: 'get',
        params: {
            id: id.toString()
        }
    })
}

// 新增邮件发送
export function addPluginMail(data: object) {
    return request({
        url: '/api/v1/plugins/mail/mail/add',
        method: 'post',
        data: data
    })
}

// 修改邮件发送
export function updatePluginMail(data: object) {
    return request({
        url: '/api/v1/plugins/mail/mail/edit',
        method: 'put',
        data: data
    })
}

// 删除邮件发送
export function delPluginMail(ids: number[]) {
    return request({
        url: '/api/v1/plugins/mail/mail/delete',
        method: 'delete',
        data: {
            ids: ids
        }
    })
}

export function sendMail(data: object) {
    return request({
        url: '/api/v1/plugins/mail/mail/sendData',
        method: 'post',
        data: data
    })
}
